package cn.zealon.readingcloud.account.feign.fallback;

import cn.zealon.readingcloud.account.feign.client.LikeSeeClient;
import cn.zealon.readingcloud.common.result.Result;
import cn.zealon.readingcloud.common.result.ResultUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;


// 修改类的实现方式
@Component
public class LikeSeeClientFallBack implements LikeSeeClient { // 直接实现接口，而不是实现FallbackFactory

    private static final Logger LOGGER = LoggerFactory.getLogger(LikeSeeClientFallBack.class);

    // 移除create方法，直接实现接口方法
    @Override
    public Result<Integer> getBookLikesCount(String bookId) {
        LOGGER.error("获取喜欢看[{}]数量失败", bookId);
        return ResultUtil.success(0);
    }
}

